<?xml version="1.0" encoding="ascii"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
          "DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
  <title>pymsn.p2p</title>
  <link rel="stylesheet" href="epydoc.css" type="text/css" />
  <script type="text/javascript" src="epydoc.js"></script>
</head>

<body bgcolor="white" text="black" link="blue" vlink="#204080"
      alink="#204080">
<!-- ==================== NAVIGATION BAR ==================== -->
<table class="navbar" border="0" width="100%" cellpadding="0"
       bgcolor="#a0c0ff" cellspacing="0">
  <tr valign="middle">

  <!-- Tree link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="module-tree.html">Trees</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Index link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="identifier-index.html">Indices</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Help link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="help.html">Help</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Project homepage -->
      <th class="navbar" align="right" width="100%">
        <table border="0" cellpadding="0" cellspacing="0">
          <tr><th class="navbar" align="center"
            ><a class="navbar" target="_top" href="http://telepathy.freedesktop.org/wiki/Pymsn">pymsn</a></th>
          </tr></table></th>
  </tr>
</table>
<table width="100%" cellpadding="0" cellspacing="0">
  <tr valign="top">
    <td width="100%">
      <span class="breadcrumbs">
        Package&nbsp;pymsn ::
        Module&nbsp;p2p
      </span>
    </td>
    <td>
      <table cellpadding="0" cellspacing="0">
        <!-- hide/show private -->
      </table>
    </td>
  </tr>
</table>
<h1 class="epydoc">Source Code for <a href="pymsn.p2p-module.html">Module pymsn.p2p</a></h1>
<pre class="py-src">
<a name="L1"></a><tt class="py-lineno">  1</tt>  <tt class="py-line"><tt class="py-comment"># -*- coding: utf-8 -*-</tt> </tt>
<a name="L2"></a><tt class="py-lineno">  2</tt>  <tt class="py-line"><tt class="py-comment"></tt><tt class="py-comment">#</tt> </tt>
<a name="L3"></a><tt class="py-lineno">  3</tt>  <tt class="py-line"><tt class="py-comment"></tt><tt class="py-comment"># pymsn - a python client library for Msn</tt> </tt>
<a name="L4"></a><tt class="py-lineno">  4</tt>  <tt class="py-line"><tt class="py-comment"></tt><tt class="py-comment">#</tt> </tt>
<a name="L5"></a><tt class="py-lineno">  5</tt>  <tt class="py-line"><tt class="py-comment"></tt><tt class="py-comment"># Copyright (C) 2007 Ali Sabil &lt;ali.sabil@gmail.com&gt;</tt> </tt>
<a name="L6"></a><tt class="py-lineno">  6</tt>  <tt class="py-line"><tt class="py-comment"></tt><tt class="py-comment"># Copyright (C) 2007 Johann Prieur &lt;johann.prieur@gmail.com&gt;</tt> </tt>
<a name="L7"></a><tt class="py-lineno">  7</tt>  <tt class="py-line"><tt class="py-comment"></tt><tt class="py-comment">#</tt> </tt>
<a name="L8"></a><tt class="py-lineno">  8</tt>  <tt class="py-line"><tt class="py-comment"></tt><tt class="py-comment"># This program is free software; you can redistribute it and/or modify</tt> </tt>
<a name="L9"></a><tt class="py-lineno">  9</tt>  <tt class="py-line"><tt class="py-comment"></tt><tt class="py-comment"># it under the terms of the GNU General Public License as published by</tt> </tt>
<a name="L10"></a><tt class="py-lineno"> 10</tt>  <tt class="py-line"><tt class="py-comment"></tt><tt class="py-comment"># the Free Software Foundation; either version 2 of the License, or</tt> </tt>
<a name="L11"></a><tt class="py-lineno"> 11</tt>  <tt class="py-line"><tt class="py-comment"></tt><tt class="py-comment"># (at your option) any later version.</tt> </tt>
<a name="L12"></a><tt class="py-lineno"> 12</tt>  <tt class="py-line"><tt class="py-comment"></tt><tt class="py-comment">#</tt> </tt>
<a name="L13"></a><tt class="py-lineno"> 13</tt>  <tt class="py-line"><tt class="py-comment"></tt><tt class="py-comment"># This program is distributed in the hope that it will be useful,</tt> </tt>
<a name="L14"></a><tt class="py-lineno"> 14</tt>  <tt class="py-line"><tt class="py-comment"></tt><tt class="py-comment"># but WITHOUT ANY WARRANTY; without even the implied warranty of</tt> </tt>
<a name="L15"></a><tt class="py-lineno"> 15</tt>  <tt class="py-line"><tt class="py-comment"></tt><tt class="py-comment"># MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the</tt> </tt>
<a name="L16"></a><tt class="py-lineno"> 16</tt>  <tt class="py-line"><tt class="py-comment"></tt><tt class="py-comment"># GNU General Public License for more details.</tt> </tt>
<a name="L17"></a><tt class="py-lineno"> 17</tt>  <tt class="py-line"><tt class="py-comment"></tt><tt class="py-comment">#</tt> </tt>
<a name="L18"></a><tt class="py-lineno"> 18</tt>  <tt class="py-line"><tt class="py-comment"></tt><tt class="py-comment"># You should have received a copy of the GNU General Public License</tt> </tt>
<a name="L19"></a><tt class="py-lineno"> 19</tt>  <tt class="py-line"><tt class="py-comment"></tt><tt class="py-comment"># along with this program; if not, write to the Free Software</tt> </tt>
<a name="L20"></a><tt class="py-lineno"> 20</tt>  <tt class="py-line"><tt class="py-comment"></tt><tt class="py-comment"># Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA</tt> </tt>
<a name="L21"></a><tt class="py-lineno"> 21</tt>  <tt class="py-line"><tt class="py-comment"></tt> </tt>
<a name="L22"></a><tt class="py-lineno"> 22</tt>  <tt class="py-line"><tt class="py-docstring">"""P2P</tt> </tt>
<a name="L23"></a><tt class="py-lineno"> 23</tt>  <tt class="py-line"><tt class="py-docstring">This module contains the classes needed to engage in a peer to peer transfer</tt> </tt>
<a name="L24"></a><tt class="py-lineno"> 24</tt>  <tt class="py-line"><tt class="py-docstring">with a contact.</tt> </tt>
<a name="L25"></a><tt class="py-lineno"> 25</tt>  <tt class="py-line"><tt class="py-docstring">    @group MSNObject: MSNObjectStore, MSNObject, MSNObjectType</tt> </tt>
<a name="L26"></a><tt class="py-lineno"> 26</tt>  <tt class="py-line"><tt class="py-docstring">    @sort: MSNObjectStore, MSNObject, MSNObjectType"""</tt> </tt>
<a name="L27"></a><tt class="py-lineno"> 27</tt>  <tt class="py-line"> </tt>
<a name="L28"></a><tt class="py-lineno"> 28</tt>  <tt class="py-line"><tt class="py-keyword">from</tt> <tt class="py-name">msnp2p</tt> <tt class="py-keyword">import</tt> <tt class="py-name">OutgoingP2PSession</tt><tt class="py-op">,</tt> <tt class="py-name">EufGuid</tt><tt class="py-op">,</tt> <tt class="py-name">ApplicationID</tt> </tt>
<a name="L29"></a><tt class="py-lineno"> 29</tt>  <tt class="py-line"><tt class="py-keyword">from</tt> <tt class="py-name">msnp2p</tt><tt class="py-op">.</tt><tt class="py-name">exceptions</tt> <tt class="py-keyword">import</tt> <tt class="py-name">ParseError</tt> </tt>
<a name="L30"></a><tt class="py-lineno"> 30</tt>  <tt class="py-line"><tt class="py-keyword">from</tt> <tt id="link-0" class="py-name" targets="Variable pymsn.client.Client.profile=pymsn.client.Client-class.html#profile,Module pymsn.event.profile=pymsn.event.profile-module.html,Module pymsn.profile=pymsn.profile-module.html,Variable pymsn.profile.Profile.profile=pymsn.profile.Profile-class.html#profile"><a title="pymsn.client.Client.profile
pymsn.event.profile
pymsn.profile
pymsn.profile.Profile.profile" class="py-name" href="#" onclick="return doclink('link-0', 'profile', 'link-0');">profile</a></tt> <tt class="py-keyword">import</tt> <tt id="link-1" class="py-name" targets="Class pymsn.profile.NetworkID=pymsn.profile.NetworkID-class.html"><a title="pymsn.profile.NetworkID" class="py-name" href="#" onclick="return doclink('link-1', 'NetworkID', 'link-1');">NetworkID</a></tt> </tt>
<a name="L31"></a><tt class="py-lineno"> 31</tt>  <tt class="py-line"> </tt>
<a name="L32"></a><tt class="py-lineno"> 32</tt>  <tt class="py-line"><tt class="py-keyword">import</tt> <tt class="py-name">pymsn</tt><tt class="py-op">.</tt><tt class="py-name">util</tt><tt class="py-op">.</tt><tt class="py-name">element_tree</tt> <tt class="py-keyword">as</tt> <tt class="py-name">ElementTree</tt> </tt>
<a name="L33"></a><tt class="py-lineno"> 33</tt>  <tt class="py-line"><tt class="py-keyword">import</tt> <tt class="py-name">pymsn</tt><tt class="py-op">.</tt><tt class="py-name">util</tt><tt class="py-op">.</tt><tt class="py-name">string_io</tt> <tt class="py-keyword">as</tt> <tt class="py-name">StringIO</tt> </tt>
<a name="L34"></a><tt class="py-lineno"> 34</tt>  <tt class="py-line"> </tt>
<a name="L35"></a><tt class="py-lineno"> 35</tt>  <tt class="py-line"><tt class="py-keyword">import</tt> <tt class="py-name">xml</tt><tt class="py-op">.</tt><tt class="py-name">sax</tt><tt class="py-op">.</tt><tt class="py-name">saxutils</tt> <tt class="py-keyword">as</tt> <tt class="py-name">xml</tt> </tt>
<a name="L36"></a><tt class="py-lineno"> 36</tt>  <tt class="py-line"><tt class="py-keyword">import</tt> <tt class="py-name">urllib</tt> </tt>
<a name="L37"></a><tt class="py-lineno"> 37</tt>  <tt class="py-line"><tt class="py-keyword">import</tt> <tt class="py-name">base64</tt> </tt>
<a name="L38"></a><tt class="py-lineno"> 38</tt>  <tt class="py-line"><tt class="py-keyword">import</tt> <tt class="py-name">sha</tt> </tt>
<a name="L39"></a><tt class="py-lineno"> 39</tt>  <tt class="py-line"><tt class="py-keyword">import</tt> <tt class="py-name">logging</tt> </tt>
<a name="L40"></a><tt class="py-lineno"> 40</tt>  <tt class="py-line"> </tt>
<a name="L41"></a><tt class="py-lineno"> 41</tt>  <tt class="py-line"><tt class="py-name">__all__</tt> <tt class="py-op">=</tt> <tt class="py-op">[</tt><tt class="py-string">'MSNObjectType'</tt><tt class="py-op">,</tt> <tt class="py-string">'MSNObject'</tt><tt class="py-op">,</tt> <tt class="py-string">'MSNObjectStore'</tt><tt class="py-op">]</tt> </tt>
<a name="L42"></a><tt class="py-lineno"> 42</tt>  <tt class="py-line"> </tt>
<a name="L43"></a><tt class="py-lineno"> 43</tt>  <tt class="py-line"><tt id="link-2" class="py-name" targets="Variable pymsn.client.logger=pymsn.client-module.html#logger,Variable pymsn.conversation.logger=pymsn.conversation-module.html#logger,Variable pymsn.p2p.logger=pymsn.p2p-module.html#logger"><a title="pymsn.client.logger
pymsn.conversation.logger
pymsn.p2p.logger" class="py-name" href="#" onclick="return doclink('link-2', 'logger', 'link-2');">logger</a></tt> <tt class="py-op">=</tt> <tt class="py-name">logging</tt><tt class="py-op">.</tt><tt class="py-name">getLogger</tt><tt class="py-op">(</tt><tt class="py-string">'p2p'</tt><tt class="py-op">)</tt> </tt>
<a name="MSNObjectType"></a><div id="MSNObjectType-def"><a name="L44"></a><tt class="py-lineno"> 44</tt>  <tt class="py-line"> </tt>
<a name="L45"></a><tt class="py-lineno"> 45</tt> <a class="py-toggle" href="#" id="MSNObjectType-toggle" onclick="return toggle('MSNObjectType');">-</a><tt class="py-line"><tt class="py-keyword">class</tt> <a class="py-def-name" href="pymsn.p2p.MSNObjectType-class.html">MSNObjectType</a><tt class="py-op">(</tt><tt class="py-base-class">object</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="MSNObjectType-collapsed" style="display:none;" pad="+++" indent="++++"></div><div id="MSNObjectType-expanded"><a name="L46"></a><tt class="py-lineno"> 46</tt>  <tt class="py-line">    <tt class="py-docstring">"""Represent the various MSNObject types"""</tt> </tt>
<a name="L47"></a><tt class="py-lineno"> 47</tt>  <tt class="py-line"> </tt>
<a name="L48"></a><tt class="py-lineno"> 48</tt>  <tt class="py-line">    <tt id="link-3" class="py-name" targets="Variable pymsn.p2p.MSNObjectType.CUSTOM_EMOTICON=pymsn.p2p.MSNObjectType-class.html#CUSTOM_EMOTICON"><a title="pymsn.p2p.MSNObjectType.CUSTOM_EMOTICON" class="py-name" href="#" onclick="return doclink('link-3', 'CUSTOM_EMOTICON', 'link-3');">CUSTOM_EMOTICON</a></tt> <tt class="py-op">=</tt> <tt class="py-number">2</tt> </tt>
<a name="L49"></a><tt class="py-lineno"> 49</tt>  <tt class="py-line">    <tt class="py-string">"Custom smiley"</tt> </tt>
<a name="L50"></a><tt class="py-lineno"> 50</tt>  <tt class="py-line">    <tt id="link-4" class="py-name" targets="Variable pymsn.p2p.MSNObjectType.DISPLAY_PICTURE=pymsn.p2p.MSNObjectType-class.html#DISPLAY_PICTURE"><a title="pymsn.p2p.MSNObjectType.DISPLAY_PICTURE" class="py-name" href="#" onclick="return doclink('link-4', 'DISPLAY_PICTURE', 'link-4');">DISPLAY_PICTURE</a></tt> <tt class="py-op">=</tt> <tt class="py-number">3</tt> </tt>
<a name="L51"></a><tt class="py-lineno"> 51</tt>  <tt class="py-line">    <tt class="py-string">"Display picture"</tt> </tt>
<a name="L52"></a><tt class="py-lineno"> 52</tt>  <tt class="py-line">    <tt id="link-5" class="py-name" targets="Variable pymsn.p2p.MSNObjectType.BACKGROUND_PICTURE=pymsn.p2p.MSNObjectType-class.html#BACKGROUND_PICTURE"><a title="pymsn.p2p.MSNObjectType.BACKGROUND_PICTURE" class="py-name" href="#" onclick="return doclink('link-5', 'BACKGROUND_PICTURE', 'link-5');">BACKGROUND_PICTURE</a></tt> <tt class="py-op">=</tt> <tt class="py-number">5</tt> </tt>
<a name="L53"></a><tt class="py-lineno"> 53</tt>  <tt class="py-line">    <tt class="py-string">"Background picture"</tt> </tt>
<a name="L54"></a><tt class="py-lineno"> 54</tt>  <tt class="py-line">    <tt id="link-6" class="py-name" targets="Variable pymsn.p2p.MSNObjectType.DYNAMIC_DISPLAY_PICTURE=pymsn.p2p.MSNObjectType-class.html#DYNAMIC_DISPLAY_PICTURE"><a title="pymsn.p2p.MSNObjectType.DYNAMIC_DISPLAY_PICTURE" class="py-name" href="#" onclick="return doclink('link-6', 'DYNAMIC_DISPLAY_PICTURE', 'link-6');">DYNAMIC_DISPLAY_PICTURE</a></tt> <tt class="py-op">=</tt> <tt class="py-number">7</tt> </tt>
<a name="L55"></a><tt class="py-lineno"> 55</tt>  <tt class="py-line">    <tt class="py-string">"Dynamic display picture"</tt> </tt>
<a name="L56"></a><tt class="py-lineno"> 56</tt>  <tt class="py-line">    <tt id="link-7" class="py-name" targets="Variable pymsn.p2p.MSNObjectType.WINK=pymsn.p2p.MSNObjectType-class.html#WINK"><a title="pymsn.p2p.MSNObjectType.WINK" class="py-name" href="#" onclick="return doclink('link-7', 'WINK', 'link-7');">WINK</a></tt> <tt class="py-op">=</tt> <tt class="py-number">8</tt> </tt>
<a name="L57"></a><tt class="py-lineno"> 57</tt>  <tt class="py-line">    <tt class="py-string">"Wink"</tt> </tt>
<a name="L58"></a><tt class="py-lineno"> 58</tt>  <tt class="py-line">    <tt id="link-8" class="py-name" targets="Variable pymsn.p2p.MSNObjectType.VOICE_CLIP=pymsn.p2p.MSNObjectType-class.html#VOICE_CLIP"><a title="pymsn.p2p.MSNObjectType.VOICE_CLIP" class="py-name" href="#" onclick="return doclink('link-8', 'VOICE_CLIP', 'link-8');">VOICE_CLIP</a></tt> <tt class="py-op">=</tt> <tt class="py-number">11</tt> </tt>
<a name="L59"></a><tt class="py-lineno"> 59</tt>  <tt class="py-line">    <tt class="py-string">"Void clip"</tt> </tt>
<a name="L60"></a><tt class="py-lineno"> 60</tt>  <tt class="py-line">    <tt id="link-9" class="py-name" targets="Variable pymsn.p2p.MSNObjectType.SAVED_STATE_PROPERTY=pymsn.p2p.MSNObjectType-class.html#SAVED_STATE_PROPERTY"><a title="pymsn.p2p.MSNObjectType.SAVED_STATE_PROPERTY" class="py-name" href="#" onclick="return doclink('link-9', 'SAVED_STATE_PROPERTY', 'link-9');">SAVED_STATE_PROPERTY</a></tt> <tt class="py-op">=</tt> <tt class="py-number">12</tt> </tt>
<a name="L61"></a><tt class="py-lineno"> 61</tt>  <tt class="py-line">    <tt class="py-string">"Saved state property"</tt> </tt>
<a name="L62"></a><tt class="py-lineno"> 62</tt>  <tt class="py-line">    <tt id="link-10" class="py-name" targets="Variable pymsn.p2p.MSNObjectType.LOCATION=pymsn.p2p.MSNObjectType-class.html#LOCATION"><a title="pymsn.p2p.MSNObjectType.LOCATION" class="py-name" href="#" onclick="return doclink('link-10', 'LOCATION', 'link-10');">LOCATION</a></tt> <tt class="py-op">=</tt> <tt class="py-number">14</tt> </tt>
<a name="L63"></a><tt class="py-lineno"> 63</tt>  <tt class="py-line">    <tt class="py-string">"Location"</tt> </tt>
</div><a name="L64"></a><tt class="py-lineno"> 64</tt>  <tt class="py-line"> </tt>
<a name="MSNObject"></a><div id="MSNObject-def"><a name="L65"></a><tt class="py-lineno"> 65</tt> <a class="py-toggle" href="#" id="MSNObject-toggle" onclick="return toggle('MSNObject');">-</a><tt class="py-line"><tt class="py-keyword">class</tt> <a class="py-def-name" href="pymsn.p2p.MSNObject-class.html">MSNObject</a><tt class="py-op">(</tt><tt class="py-base-class">object</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="MSNObject-collapsed" style="display:none;" pad="+++" indent="++++"></div><div id="MSNObject-expanded"><a name="L66"></a><tt class="py-lineno"> 66</tt>  <tt class="py-line">    <tt class="py-docstring">"Represents an MSNObject."</tt> </tt>
<a name="MSNObject.__init__"></a><div id="MSNObject.__init__-def"><a name="L67"></a><tt class="py-lineno"> 67</tt> <a class="py-toggle" href="#" id="MSNObject.__init__-toggle" onclick="return toggle('MSNObject.__init__');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="pymsn.p2p.MSNObject-class.html#__init__">__init__</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">,</tt> <tt class="py-param">creator</tt><tt class="py-op">,</tt> <tt class="py-param">size</tt><tt class="py-op">,</tt> <tt class="py-param">type</tt><tt class="py-op">,</tt> <tt class="py-param">location</tt><tt class="py-op">,</tt> <tt class="py-param">friendly</tt><tt class="py-op">,</tt>  </tt>
<a name="L68"></a><tt class="py-lineno"> 68</tt>  <tt class="py-line">                 <tt class="py-param">shad</tt><tt class="py-op">=</tt><tt class="py-name">None</tt><tt class="py-op">,</tt> <tt class="py-param">shac</tt><tt class="py-op">=</tt><tt class="py-name">None</tt><tt class="py-op">,</tt> <tt class="py-param">data</tt><tt class="py-op">=</tt><tt class="py-name">None</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="MSNObject.__init__-collapsed" style="display:none;" pad="+++" indent="++++++++"></div><div id="MSNObject.__init__-expanded"><a name="L69"></a><tt class="py-lineno"> 69</tt>  <tt class="py-line">        <tt class="py-docstring">"""Initializer</tt> </tt>
<a name="L70"></a><tt class="py-lineno"> 70</tt>  <tt class="py-line"><tt class="py-docstring">        </tt> </tt>
<a name="L71"></a><tt class="py-lineno"> 71</tt>  <tt class="py-line"><tt class="py-docstring">            @param creator: the creator of this MSNObject</tt> </tt>
<a name="L72"></a><tt class="py-lineno"> 72</tt>  <tt class="py-line"><tt class="py-docstring">            @type creator: utf-8 encoded string representing the account</tt> </tt>
<a name="L73"></a><tt class="py-lineno"> 73</tt>  <tt class="py-line"><tt class="py-docstring"></tt> </tt>
<a name="L74"></a><tt class="py-lineno"> 74</tt>  <tt class="py-line"><tt class="py-docstring">            @param size: the total size of the data represented by this MSNObject</tt> </tt>
<a name="L75"></a><tt class="py-lineno"> 75</tt>  <tt class="py-line"><tt class="py-docstring">            @type size: int</tt> </tt>
<a name="L76"></a><tt class="py-lineno"> 76</tt>  <tt class="py-line"><tt class="py-docstring"></tt> </tt>
<a name="L77"></a><tt class="py-lineno"> 77</tt>  <tt class="py-line"><tt class="py-docstring">            @param type: the type of the data</tt> </tt>
<a name="L78"></a><tt class="py-lineno"> 78</tt>  <tt class="py-line"><tt class="py-docstring">            @type type: L{MSNObjectType}</tt> </tt>
<a name="L79"></a><tt class="py-lineno"> 79</tt>  <tt class="py-line"><tt class="py-docstring"></tt> </tt>
<a name="L80"></a><tt class="py-lineno"> 80</tt>  <tt class="py-line"><tt class="py-docstring">            @param location: a filename for the MSNObject</tt> </tt>
<a name="L81"></a><tt class="py-lineno"> 81</tt>  <tt class="py-line"><tt class="py-docstring">            @type location: utf-8 encoded string</tt> </tt>
<a name="L82"></a><tt class="py-lineno"> 82</tt>  <tt class="py-line"><tt class="py-docstring"></tt> </tt>
<a name="L83"></a><tt class="py-lineno"> 83</tt>  <tt class="py-line"><tt class="py-docstring">            @param friendly: a friendly name for the MSNObject</tt> </tt>
<a name="L84"></a><tt class="py-lineno"> 84</tt>  <tt class="py-line"><tt class="py-docstring">            @type friendly: utf-8 encoded string</tt> </tt>
<a name="L85"></a><tt class="py-lineno"> 85</tt>  <tt class="py-line"><tt class="py-docstring"></tt> </tt>
<a name="L86"></a><tt class="py-lineno"> 86</tt>  <tt class="py-line"><tt class="py-docstring">            @param shad: sha1 digest of the data</tt> </tt>
<a name="L87"></a><tt class="py-lineno"> 87</tt>  <tt class="py-line"><tt class="py-docstring"></tt> </tt>
<a name="L88"></a><tt class="py-lineno"> 88</tt>  <tt class="py-line"><tt class="py-docstring">            @param shac: sha1 digest of the MSNObject itself</tt> </tt>
<a name="L89"></a><tt class="py-lineno"> 89</tt>  <tt class="py-line"><tt class="py-docstring"></tt> </tt>
<a name="L90"></a><tt class="py-lineno"> 90</tt>  <tt class="py-line"><tt class="py-docstring">            @param data: file object to the data represented by this MSNObject</tt> </tt>
<a name="L91"></a><tt class="py-lineno"> 91</tt>  <tt class="py-line"><tt class="py-docstring">            @type data: File</tt> </tt>
<a name="L92"></a><tt class="py-lineno"> 92</tt>  <tt class="py-line"><tt class="py-docstring">        """</tt> </tt>
<a name="L93"></a><tt class="py-lineno"> 93</tt>  <tt class="py-line">        <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">_creator</tt> <tt class="py-op">=</tt> <tt class="py-name">creator</tt> </tt>
<a name="L94"></a><tt class="py-lineno"> 94</tt>  <tt class="py-line">        <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">_size</tt> <tt class="py-op">=</tt> <tt class="py-name">size</tt> </tt>
<a name="L95"></a><tt class="py-lineno"> 95</tt>  <tt class="py-line">        <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">_type</tt> <tt class="py-op">=</tt> <tt class="py-name">type</tt> </tt>
<a name="L96"></a><tt class="py-lineno"> 96</tt>  <tt class="py-line">        <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">_location</tt> <tt class="py-op">=</tt> <tt class="py-name">location</tt> </tt>
<a name="L97"></a><tt class="py-lineno"> 97</tt>  <tt class="py-line">        <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">_friendly</tt> <tt class="py-op">=</tt> <tt class="py-name">friendly</tt> </tt>
<a name="L98"></a><tt class="py-lineno"> 98</tt>  <tt class="py-line">        <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">_checksum_sha</tt> <tt class="py-op">=</tt> <tt class="py-name">shac</tt> </tt>
<a name="L99"></a><tt class="py-lineno"> 99</tt>  <tt class="py-line"> </tt>
<a name="L100"></a><tt class="py-lineno">100</tt>  <tt class="py-line">        <tt class="py-keyword">if</tt> <tt class="py-name">shad</tt> <tt class="py-keyword">is</tt> <tt class="py-name">None</tt><tt class="py-op">:</tt> </tt>
<a name="L101"></a><tt class="py-lineno">101</tt>  <tt class="py-line">            <tt class="py-keyword">if</tt> <tt class="py-name">data</tt> <tt class="py-keyword">is</tt> <tt class="py-name">None</tt><tt class="py-op">:</tt> </tt>
<a name="L102"></a><tt class="py-lineno">102</tt>  <tt class="py-line">                <tt class="py-keyword">raise</tt> <tt class="py-name">NotImplementedError</tt>                 </tt>
<a name="L103"></a><tt class="py-lineno">103</tt>  <tt class="py-line">            <tt class="py-name">shad</tt> <tt class="py-op">=</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">__compute_data_hash</tt><tt class="py-op">(</tt><tt class="py-name">data</tt><tt class="py-op">)</tt> </tt>
<a name="L104"></a><tt class="py-lineno">104</tt>  <tt class="py-line">        <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">_data_sha</tt> <tt class="py-op">=</tt> <tt class="py-name">shad</tt> </tt>
<a name="L105"></a><tt class="py-lineno">105</tt>  <tt class="py-line">        <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">__data</tt> <tt class="py-op">=</tt> <tt class="py-name">data</tt> </tt>
<a name="L106"></a><tt class="py-lineno">106</tt>  <tt class="py-line">        <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">_repr</tt> <tt class="py-op">=</tt> <tt class="py-name">None</tt> </tt>
</div><a name="L107"></a><tt class="py-lineno">107</tt>  <tt class="py-line"> </tt>
<a name="MSNObject.__ne__"></a><div id="MSNObject.__ne__-def"><a name="L108"></a><tt class="py-lineno">108</tt> <a class="py-toggle" href="#" id="MSNObject.__ne__-toggle" onclick="return toggle('MSNObject.__ne__');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="pymsn.p2p.MSNObject-class.html#__ne__">__ne__</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">,</tt> <tt class="py-param">other</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="MSNObject.__ne__-collapsed" style="display:none;" pad="+++" indent="++++++++"></div><div id="MSNObject.__ne__-expanded"><a name="L109"></a><tt class="py-lineno">109</tt>  <tt class="py-line">        <tt class="py-keyword">return</tt> <tt class="py-keyword">not</tt> <tt class="py-op">(</tt><tt class="py-name">self</tt> <tt class="py-op">==</tt> <tt class="py-name">other</tt><tt class="py-op">)</tt> </tt>
</div><a name="L110"></a><tt class="py-lineno">110</tt>  <tt class="py-line"> </tt>
<a name="MSNObject.__eq__"></a><div id="MSNObject.__eq__-def"><a name="L111"></a><tt class="py-lineno">111</tt> <a class="py-toggle" href="#" id="MSNObject.__eq__-toggle" onclick="return toggle('MSNObject.__eq__');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="pymsn.p2p.MSNObject-class.html#__eq__">__eq__</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">,</tt> <tt class="py-param">other</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="MSNObject.__eq__-collapsed" style="display:none;" pad="+++" indent="++++++++"></div><div id="MSNObject.__eq__-expanded"><a name="L112"></a><tt class="py-lineno">112</tt>  <tt class="py-line">        <tt class="py-keyword">if</tt> <tt class="py-name">other</tt> <tt class="py-op">==</tt> <tt class="py-name">None</tt><tt class="py-op">:</tt> </tt>
<a name="L113"></a><tt class="py-lineno">113</tt>  <tt class="py-line">            <tt class="py-keyword">return</tt> <tt class="py-name">False</tt> </tt>
<a name="L114"></a><tt class="py-lineno">114</tt>  <tt class="py-line">        <tt class="py-keyword">return</tt> <tt class="py-name">other</tt><tt class="py-op">.</tt><tt class="py-name">_type</tt> <tt class="py-op">==</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">_type</tt> <tt class="py-keyword">and</tt> \ </tt>
<a name="L115"></a><tt class="py-lineno">115</tt>  <tt class="py-line">            <tt class="py-name">other</tt><tt class="py-op">.</tt><tt class="py-name">_data_sha</tt> <tt class="py-op">==</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">_data_sha</tt> </tt>
</div><a name="L116"></a><tt class="py-lineno">116</tt>  <tt class="py-line"> </tt>
<a name="MSNObject.__hash__"></a><div id="MSNObject.__hash__-def"><a name="L117"></a><tt class="py-lineno">117</tt> <a class="py-toggle" href="#" id="MSNObject.__hash__-toggle" onclick="return toggle('MSNObject.__hash__');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="pymsn.p2p.MSNObject-class.html#__hash__">__hash__</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="MSNObject.__hash__-collapsed" style="display:none;" pad="+++" indent="++++++++"></div><div id="MSNObject.__hash__-expanded"><a name="L118"></a><tt class="py-lineno">118</tt>  <tt class="py-line">        <tt class="py-keyword">return</tt> <tt class="py-name">hash</tt><tt class="py-op">(</tt><tt class="py-name">str</tt><tt class="py-op">(</tt><tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">_type</tt><tt class="py-op">)</tt> <tt class="py-op">+</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">_data_sha</tt><tt class="py-op">)</tt> </tt>
</div><a name="L119"></a><tt class="py-lineno">119</tt>  <tt class="py-line"> </tt>
<a name="MSNObject.__set_data"></a><div id="MSNObject.__set_data-def"><a name="L120"></a><tt class="py-lineno">120</tt> <a class="py-toggle" href="#" id="MSNObject.__set_data-toggle" onclick="return toggle('MSNObject.__set_data');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="pymsn.p2p.MSNObject-class.html#__set_data">__set_data</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">,</tt> <tt class="py-param">data</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="MSNObject.__set_data-collapsed" style="display:none;" pad="+++" indent="++++++++"></div><div id="MSNObject.__set_data-expanded"><a name="L121"></a><tt class="py-lineno">121</tt>  <tt class="py-line">        <tt class="py-keyword">if</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">_data_sha</tt> <tt class="py-op">!=</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">__compute_data_hash</tt><tt class="py-op">(</tt><tt class="py-name">data</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
<a name="L122"></a><tt class="py-lineno">122</tt>  <tt class="py-line">            <tt id="link-11" class="py-name"><a title="pymsn.client.logger
pymsn.conversation.logger
pymsn.p2p.logger" class="py-name" href="#" onclick="return doclink('link-11', 'logger', 'link-2');">logger</a></tt><tt class="py-op">.</tt><tt class="py-name">warning</tt><tt class="py-op">(</tt><tt class="py-string">"Received data doesn't match the MSNObject data hash."</tt><tt class="py-op">)</tt> </tt>
<a name="L123"></a><tt class="py-lineno">123</tt>  <tt class="py-line">            <tt class="py-keyword">return</tt> </tt>
<a name="L124"></a><tt class="py-lineno">124</tt>  <tt class="py-line"> </tt>
<a name="L125"></a><tt class="py-lineno">125</tt>  <tt class="py-line">        <tt class="py-name">old_pos</tt> <tt class="py-op">=</tt> <tt class="py-name">data</tt><tt class="py-op">.</tt><tt class="py-name">tell</tt><tt class="py-op">(</tt><tt class="py-op">)</tt> </tt>
<a name="L126"></a><tt class="py-lineno">126</tt>  <tt class="py-line">        <tt class="py-name">data</tt><tt class="py-op">.</tt><tt class="py-name">seek</tt><tt class="py-op">(</tt><tt class="py-number">0</tt><tt class="py-op">,</tt> <tt class="py-number">2</tt><tt class="py-op">)</tt> </tt>
<a name="L127"></a><tt class="py-lineno">127</tt>  <tt class="py-line">        <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">_size</tt> <tt class="py-op">=</tt> <tt class="py-name">data</tt><tt class="py-op">.</tt><tt class="py-name">tell</tt><tt class="py-op">(</tt><tt class="py-op">)</tt> </tt>
<a name="L128"></a><tt class="py-lineno">128</tt>  <tt class="py-line">        <tt class="py-name">data</tt><tt class="py-op">.</tt><tt class="py-name">seek</tt><tt class="py-op">(</tt><tt class="py-name">old_pos</tt><tt class="py-op">,</tt> <tt class="py-number">0</tt><tt class="py-op">)</tt> </tt>
<a name="L129"></a><tt class="py-lineno">129</tt>  <tt class="py-line"> </tt>
<a name="L130"></a><tt class="py-lineno">130</tt>  <tt class="py-line">        <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">__data</tt> <tt class="py-op">=</tt> <tt class="py-name">data</tt> </tt>
<a name="L131"></a><tt class="py-lineno">131</tt>  <tt class="py-line">        <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">_checksum_sha</tt> <tt class="py-op">=</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">__compute_checksum</tt><tt class="py-op">(</tt><tt class="py-op">)</tt> </tt>
</div><a name="MSNObject.__get_data"></a><div id="MSNObject.__get_data-def"><a name="L132"></a><tt class="py-lineno">132</tt> <a class="py-toggle" href="#" id="MSNObject.__get_data-toggle" onclick="return toggle('MSNObject.__get_data');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="pymsn.p2p.MSNObject-class.html#__get_data">__get_data</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="MSNObject.__get_data-collapsed" style="display:none;" pad="+++" indent="++++++++"></div><div id="MSNObject.__get_data-expanded"><a name="L133"></a><tt class="py-lineno">133</tt>  <tt class="py-line">        <tt class="py-keyword">return</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">__data</tt> </tt>
</div><a name="L134"></a><tt class="py-lineno">134</tt>  <tt class="py-line">    <tt class="py-name">_data</tt> <tt class="py-op">=</tt> <tt class="py-name">property</tt><tt class="py-op">(</tt><tt class="py-name">__get_data</tt><tt class="py-op">,</tt> <tt class="py-name">__set_data</tt><tt class="py-op">)</tt> </tt>
<a name="L135"></a><tt class="py-lineno">135</tt>  <tt class="py-line"> </tt>
<a name="L136"></a><tt class="py-lineno">136</tt>  <tt class="py-line">    <tt class="py-decorator">@</tt><tt class="py-decorator">staticmethod</tt> </tt>
<a name="MSNObject.parse"></a><div id="MSNObject.parse-def"><a name="L137"></a><tt class="py-lineno">137</tt> <a class="py-toggle" href="#" id="MSNObject.parse-toggle" onclick="return toggle('MSNObject.parse');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="pymsn.p2p.MSNObject-class.html#parse">parse</a><tt class="py-op">(</tt><tt class="py-param">client</tt><tt class="py-op">,</tt> <tt class="py-param">xml_data</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="MSNObject.parse-collapsed" style="display:none;" pad="+++" indent="++++++++"></div><div id="MSNObject.parse-expanded"><a name="L138"></a><tt class="py-lineno">138</tt>  <tt class="py-line">        <tt class="py-name">data</tt> <tt class="py-op">=</tt> <tt class="py-name">StringIO</tt><tt class="py-op">.</tt><tt class="py-name">StringIO</tt><tt class="py-op">(</tt><tt class="py-name">xml_data</tt><tt class="py-op">)</tt> </tt>
<a name="L139"></a><tt class="py-lineno">139</tt>  <tt class="py-line">        <tt class="py-keyword">try</tt><tt class="py-op">:</tt> </tt>
<a name="L140"></a><tt class="py-lineno">140</tt>  <tt class="py-line">            <tt class="py-name">element</tt> <tt class="py-op">=</tt> <tt class="py-name">ElementTree</tt><tt class="py-op">.</tt><tt id="link-12" class="py-name" targets="Static Method pymsn.conversation.TextFormat.parse()=pymsn.conversation.TextFormat-class.html#parse,Static Method pymsn.p2p.MSNObject.parse()=pymsn.p2p.MSNObject-class.html#parse"><a title="pymsn.conversation.TextFormat.parse
pymsn.p2p.MSNObject.parse" class="py-name" href="#" onclick="return doclink('link-12', 'parse', 'link-12');">parse</a></tt><tt class="py-op">(</tt><tt class="py-name">data</tt><tt class="py-op">)</tt><tt class="py-op">.</tt><tt class="py-name">getroot</tt><tt class="py-op">(</tt><tt class="py-op">)</tt><tt class="py-op">.</tt><tt class="py-name">attrib</tt> </tt>
<a name="L141"></a><tt class="py-lineno">141</tt>  <tt class="py-line">        <tt class="py-keyword">except</tt><tt class="py-op">:</tt> </tt>
<a name="L142"></a><tt class="py-lineno">142</tt>  <tt class="py-line">            <tt class="py-keyword">raise</tt> <tt class="py-name">ParseError</tt><tt class="py-op">(</tt><tt class="py-string">'Invalid MSNObject'</tt><tt class="py-op">)</tt> </tt>
<a name="L143"></a><tt class="py-lineno">143</tt>  <tt class="py-line">         </tt>
<a name="L144"></a><tt class="py-lineno">144</tt>  <tt class="py-line">        <tt class="py-keyword">try</tt><tt class="py-op">:</tt> </tt>
<a name="L145"></a><tt class="py-lineno">145</tt>  <tt class="py-line">            <tt class="py-name">creator</tt> <tt class="py-op">=</tt> <tt id="link-13" class="py-name" targets="Module pymsn.client=pymsn.client-module.html,Module pymsn.event.client=pymsn.event.client-module.html"><a title="pymsn.client
pymsn.event.client" class="py-name" href="#" onclick="return doclink('link-13', 'client', 'link-13');">client</a></tt><tt class="py-op">.</tt><tt id="link-14" class="py-name" targets="Variable pymsn.client.Client.address_book=pymsn.client.Client-class.html#address_book,Module pymsn.event.address_book=pymsn.event.address_book-module.html"><a title="pymsn.client.Client.address_book
pymsn.event.address_book" class="py-name" href="#" onclick="return doclink('link-14', 'address_book', 'link-14');">address_book</a></tt><tt class="py-op">.</tt><tt class="py-name">contacts</tt><tt class="py-op">.</tt>\ </tt>
<a name="L146"></a><tt class="py-lineno">146</tt>  <tt class="py-line">                <tt class="py-name">search_by_account</tt><tt class="py-op">(</tt><tt class="py-name">element</tt><tt class="py-op">[</tt><tt class="py-string">"Creator"</tt><tt class="py-op">]</tt><tt class="py-op">)</tt><tt class="py-op">.</tt>\ </tt>
<a name="L147"></a><tt class="py-lineno">147</tt>  <tt class="py-line">                <tt class="py-name">search_by_network_id</tt><tt class="py-op">(</tt><tt id="link-15" class="py-name"><a title="pymsn.profile.NetworkID" class="py-name" href="#" onclick="return doclink('link-15', 'NetworkID', 'link-1');">NetworkID</a></tt><tt class="py-op">.</tt><tt id="link-16" class="py-name" targets="Variable pymsn.profile.NetworkID.MSN=pymsn.profile.NetworkID-class.html#MSN"><a title="pymsn.profile.NetworkID.MSN" class="py-name" href="#" onclick="return doclink('link-16', 'MSN', 'link-16');">MSN</a></tt><tt class="py-op">)</tt><tt class="py-op">[</tt><tt class="py-number">0</tt><tt class="py-op">]</tt> </tt>
<a name="L148"></a><tt class="py-lineno">148</tt>  <tt class="py-line">        <tt class="py-keyword">except</tt> <tt class="py-name">IndexError</tt><tt class="py-op">:</tt> </tt>
<a name="L149"></a><tt class="py-lineno">149</tt>  <tt class="py-line">            <tt class="py-name">creator</tt> <tt class="py-op">=</tt> <tt class="py-name">None</tt> </tt>
<a name="L150"></a><tt class="py-lineno">150</tt>  <tt class="py-line"> </tt>
<a name="L151"></a><tt class="py-lineno">151</tt>  <tt class="py-line">        <tt class="py-name">size</tt> <tt class="py-op">=</tt> <tt class="py-name">int</tt><tt class="py-op">(</tt><tt class="py-name">element</tt><tt class="py-op">[</tt><tt class="py-string">"Size"</tt><tt class="py-op">]</tt><tt class="py-op">)</tt> </tt>
<a name="L152"></a><tt class="py-lineno">152</tt>  <tt class="py-line">        <tt class="py-name">type</tt> <tt class="py-op">=</tt> <tt class="py-name">int</tt><tt class="py-op">(</tt><tt class="py-name">element</tt><tt class="py-op">[</tt><tt class="py-string">"Type"</tt><tt class="py-op">]</tt><tt class="py-op">)</tt> </tt>
<a name="L153"></a><tt class="py-lineno">153</tt>  <tt class="py-line">        <tt class="py-name">location</tt> <tt class="py-op">=</tt> <tt class="py-name">xml</tt><tt class="py-op">.</tt><tt class="py-name">unescape</tt><tt class="py-op">(</tt><tt class="py-name">element</tt><tt class="py-op">[</tt><tt class="py-string">"Location"</tt><tt class="py-op">]</tt><tt class="py-op">)</tt> </tt>
<a name="L154"></a><tt class="py-lineno">154</tt>  <tt class="py-line">        <tt class="py-name">friendly</tt> <tt class="py-op">=</tt> <tt class="py-name">base64</tt><tt class="py-op">.</tt><tt class="py-name">b64decode</tt><tt class="py-op">(</tt><tt class="py-name">xml</tt><tt class="py-op">.</tt><tt class="py-name">unescape</tt><tt class="py-op">(</tt><tt class="py-name">element</tt><tt class="py-op">[</tt><tt class="py-string">"Friendly"</tt><tt class="py-op">]</tt><tt class="py-op">)</tt><tt class="py-op">)</tt> </tt>
<a name="L155"></a><tt class="py-lineno">155</tt>  <tt class="py-line">        <tt class="py-name">shad</tt> <tt class="py-op">=</tt> <tt class="py-name">element</tt><tt class="py-op">.</tt><tt class="py-name">get</tt><tt class="py-op">(</tt><tt class="py-string">"SHA1D"</tt><tt class="py-op">,</tt> <tt class="py-name">None</tt><tt class="py-op">)</tt> </tt>
<a name="L156"></a><tt class="py-lineno">156</tt>  <tt class="py-line">        <tt class="py-keyword">if</tt> <tt class="py-name">shad</tt> <tt class="py-keyword">is</tt> <tt class="py-keyword">not</tt> <tt class="py-name">None</tt><tt class="py-op">:</tt> </tt>
<a name="L157"></a><tt class="py-lineno">157</tt>  <tt class="py-line">            <tt class="py-name">shad</tt> <tt class="py-op">=</tt> <tt class="py-name">base64</tt><tt class="py-op">.</tt><tt class="py-name">b64decode</tt><tt class="py-op">(</tt><tt class="py-name">shad</tt><tt class="py-op">)</tt> </tt>
<a name="L158"></a><tt class="py-lineno">158</tt>  <tt class="py-line">        <tt class="py-name">shac</tt> <tt class="py-op">=</tt> <tt class="py-name">element</tt><tt class="py-op">.</tt><tt class="py-name">get</tt><tt class="py-op">(</tt><tt class="py-string">"SHA1C"</tt><tt class="py-op">,</tt> <tt class="py-name">None</tt><tt class="py-op">)</tt> </tt>
<a name="L159"></a><tt class="py-lineno">159</tt>  <tt class="py-line">        <tt class="py-keyword">if</tt> <tt class="py-name">shac</tt> <tt class="py-keyword">is</tt> <tt class="py-keyword">not</tt> <tt class="py-name">None</tt><tt class="py-op">:</tt> </tt>
<a name="L160"></a><tt class="py-lineno">160</tt>  <tt class="py-line">            <tt class="py-name">shac</tt> <tt class="py-op">=</tt> <tt class="py-name">base64</tt><tt class="py-op">.</tt><tt class="py-name">b64decode</tt><tt class="py-op">(</tt><tt class="py-name">shac</tt><tt class="py-op">)</tt> </tt>
<a name="L161"></a><tt class="py-lineno">161</tt>  <tt class="py-line"> </tt>
<a name="L162"></a><tt class="py-lineno">162</tt>  <tt class="py-line">        <tt class="py-name">result</tt> <tt class="py-op">=</tt> <tt id="link-17" class="py-name" targets="Class pymsn.p2p.MSNObject=pymsn.p2p.MSNObject-class.html"><a title="pymsn.p2p.MSNObject" class="py-name" href="#" onclick="return doclink('link-17', 'MSNObject', 'link-17');">MSNObject</a></tt><tt class="py-op">(</tt><tt class="py-name">creator</tt><tt class="py-op">,</tt> <tt class="py-name">size</tt><tt class="py-op">,</tt> <tt class="py-name">type</tt><tt class="py-op">,</tt> <tt class="py-name">location</tt><tt class="py-op">,</tt> \ </tt>
<a name="L163"></a><tt class="py-lineno">163</tt>  <tt class="py-line">                             <tt class="py-name">friendly</tt><tt class="py-op">,</tt> <tt class="py-name">shad</tt><tt class="py-op">,</tt> <tt class="py-name">shac</tt><tt class="py-op">)</tt> </tt>
<a name="L164"></a><tt class="py-lineno">164</tt>  <tt class="py-line">        <tt class="py-name">result</tt><tt class="py-op">.</tt><tt class="py-name">_repr</tt> <tt class="py-op">=</tt> <tt class="py-name">xml_data</tt> </tt>
<a name="L165"></a><tt class="py-lineno">165</tt>  <tt class="py-line">        <tt class="py-keyword">return</tt> <tt class="py-name">result</tt> </tt>
</div><a name="L166"></a><tt class="py-lineno">166</tt>  <tt class="py-line"> </tt>
<a name="MSNObject.__compute_data_hash"></a><div id="MSNObject.__compute_data_hash-def"><a name="L167"></a><tt class="py-lineno">167</tt> <a class="py-toggle" href="#" id="MSNObject.__compute_data_hash-toggle" onclick="return toggle('MSNObject.__compute_data_hash');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="pymsn.p2p.MSNObject-class.html#__compute_data_hash">__compute_data_hash</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">,</tt> <tt class="py-param">data</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="MSNObject.__compute_data_hash-collapsed" style="display:none;" pad="+++" indent="++++++++"></div><div id="MSNObject.__compute_data_hash-expanded"><a name="L168"></a><tt class="py-lineno">168</tt>  <tt class="py-line">        <tt class="py-name">digest</tt> <tt class="py-op">=</tt> <tt class="py-name">sha</tt><tt class="py-op">.</tt><tt class="py-name">new</tt><tt class="py-op">(</tt><tt class="py-op">)</tt> </tt>
<a name="L169"></a><tt class="py-lineno">169</tt>  <tt class="py-line">        <tt class="py-name">data</tt><tt class="py-op">.</tt><tt class="py-name">seek</tt><tt class="py-op">(</tt><tt class="py-number">0</tt><tt class="py-op">,</tt> <tt class="py-number">0</tt><tt class="py-op">)</tt> </tt>
<a name="L170"></a><tt class="py-lineno">170</tt>  <tt class="py-line">        <tt class="py-name">read_data</tt> <tt class="py-op">=</tt> <tt class="py-name">data</tt><tt class="py-op">.</tt><tt class="py-name">read</tt><tt class="py-op">(</tt><tt class="py-number">1024</tt><tt class="py-op">)</tt> </tt>
<a name="L171"></a><tt class="py-lineno">171</tt>  <tt class="py-line">        <tt class="py-keyword">while</tt> <tt class="py-name">len</tt><tt class="py-op">(</tt><tt class="py-name">read_data</tt><tt class="py-op">)</tt> <tt class="py-op">&gt;</tt> <tt class="py-number">0</tt><tt class="py-op">:</tt> </tt>
<a name="L172"></a><tt class="py-lineno">172</tt>  <tt class="py-line">            <tt class="py-name">digest</tt><tt class="py-op">.</tt><tt class="py-name">update</tt><tt class="py-op">(</tt><tt class="py-name">read_data</tt><tt class="py-op">)</tt> </tt>
<a name="L173"></a><tt class="py-lineno">173</tt>  <tt class="py-line">            <tt class="py-name">read_data</tt> <tt class="py-op">=</tt> <tt class="py-name">data</tt><tt class="py-op">.</tt><tt class="py-name">read</tt><tt class="py-op">(</tt><tt class="py-number">1024</tt><tt class="py-op">)</tt> </tt>
<a name="L174"></a><tt class="py-lineno">174</tt>  <tt class="py-line">        <tt class="py-name">data</tt><tt class="py-op">.</tt><tt class="py-name">seek</tt><tt class="py-op">(</tt><tt class="py-number">0</tt><tt class="py-op">,</tt> <tt class="py-number">0</tt><tt class="py-op">)</tt> </tt>
<a name="L175"></a><tt class="py-lineno">175</tt>  <tt class="py-line">        <tt class="py-keyword">return</tt> <tt class="py-name">digest</tt><tt class="py-op">.</tt><tt class="py-name">digest</tt><tt class="py-op">(</tt><tt class="py-op">)</tt> </tt>
</div><a name="L176"></a><tt class="py-lineno">176</tt>  <tt class="py-line"> </tt>
<a name="MSNObject.__compute_checksum"></a><div id="MSNObject.__compute_checksum-def"><a name="L177"></a><tt class="py-lineno">177</tt> <a class="py-toggle" href="#" id="MSNObject.__compute_checksum-toggle" onclick="return toggle('MSNObject.__compute_checksum');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="pymsn.p2p.MSNObject-class.html#__compute_checksum">__compute_checksum</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="MSNObject.__compute_checksum-collapsed" style="display:none;" pad="+++" indent="++++++++"></div><div id="MSNObject.__compute_checksum-expanded"><a name="L178"></a><tt class="py-lineno">178</tt>  <tt class="py-line">        <tt class="py-name">input</tt> <tt class="py-op">=</tt> <tt class="py-string">"Creator%sSize%sType%sLocation%sFriendly%sSHA1D%s"</tt> <tt class="py-op">%</tt> \ </tt>
<a name="L179"></a><tt class="py-lineno">179</tt>  <tt class="py-line">            <tt class="py-op">(</tt><tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">_creator</tt><tt class="py-op">.</tt><tt id="link-18" class="py-name" targets="Variable pymsn.profile.Contact.account=pymsn.profile.Contact-class.html#account,Variable pymsn.profile.Profile.account=pymsn.profile.Profile-class.html#account"><a title="pymsn.profile.Contact.account
pymsn.profile.Profile.account" class="py-name" href="#" onclick="return doclink('link-18', 'account', 'link-18');">account</a></tt><tt class="py-op">,</tt> <tt class="py-name">str</tt><tt class="py-op">(</tt><tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">_size</tt><tt class="py-op">)</tt><tt class="py-op">,</tt> <tt class="py-name">str</tt><tt class="py-op">(</tt><tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">_type</tt><tt class="py-op">)</tt><tt class="py-op">,</tt>\ </tt>
<a name="L180"></a><tt class="py-lineno">180</tt>  <tt class="py-line">                 <tt class="py-name">str</tt><tt class="py-op">(</tt><tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">_location</tt><tt class="py-op">)</tt><tt class="py-op">,</tt> <tt class="py-name">base64</tt><tt class="py-op">.</tt><tt class="py-name">b64encode</tt><tt class="py-op">(</tt><tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">_friendly</tt><tt class="py-op">)</tt><tt class="py-op">,</tt> \ </tt>
<a name="L181"></a><tt class="py-lineno">181</tt>  <tt class="py-line">                 <tt class="py-name">base64</tt><tt class="py-op">.</tt><tt class="py-name">b64encode</tt><tt class="py-op">(</tt><tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">_data_sha</tt><tt class="py-op">)</tt><tt class="py-op">)</tt> </tt>
<a name="L182"></a><tt class="py-lineno">182</tt>  <tt class="py-line">        <tt class="py-keyword">return</tt> <tt class="py-name">sha</tt><tt class="py-op">.</tt><tt class="py-name">new</tt><tt class="py-op">(</tt><tt class="py-name">input</tt><tt class="py-op">)</tt><tt class="py-op">.</tt><tt class="py-name">hexdigest</tt><tt class="py-op">(</tt><tt class="py-op">)</tt> </tt>
</div><a name="L183"></a><tt class="py-lineno">183</tt>  <tt class="py-line"> </tt>
<a name="MSNObject.__str__"></a><div id="MSNObject.__str__-def"><a name="L184"></a><tt class="py-lineno">184</tt> <a class="py-toggle" href="#" id="MSNObject.__str__-toggle" onclick="return toggle('MSNObject.__str__');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="pymsn.p2p.MSNObject-class.html#__str__">__str__</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="MSNObject.__str__-collapsed" style="display:none;" pad="+++" indent="++++++++"></div><div id="MSNObject.__str__-expanded"><a name="L185"></a><tt class="py-lineno">185</tt>  <tt class="py-line">        <tt class="py-keyword">return</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt id="link-19" class="py-name" targets="Method pymsn.conversation.TextFormat.__repr__()=pymsn.conversation.TextFormat-class.html#__repr__,Method pymsn.p2p.MSNObject.__repr__()=pymsn.p2p.MSNObject-class.html#__repr__,Method pymsn.profile.Contact.__repr__()=pymsn.profile.Contact-class.html#__repr__"><a title="pymsn.conversation.TextFormat.__repr__
pymsn.p2p.MSNObject.__repr__
pymsn.profile.Contact.__repr__" class="py-name" href="#" onclick="return doclink('link-19', '__repr__', 'link-19');">__repr__</a></tt><tt class="py-op">(</tt><tt class="py-op">)</tt> </tt>
</div><a name="L186"></a><tt class="py-lineno">186</tt>  <tt class="py-line"> </tt>
<a name="MSNObject.__repr__"></a><div id="MSNObject.__repr__-def"><a name="L187"></a><tt class="py-lineno">187</tt> <a class="py-toggle" href="#" id="MSNObject.__repr__-toggle" onclick="return toggle('MSNObject.__repr__');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="pymsn.p2p.MSNObject-class.html#__repr__">__repr__</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="MSNObject.__repr__-collapsed" style="display:none;" pad="+++" indent="++++++++"></div><div id="MSNObject.__repr__-expanded"><a name="L188"></a><tt class="py-lineno">188</tt>  <tt class="py-line">        <tt class="py-keyword">if</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">_repr</tt> <tt class="py-keyword">is</tt> <tt class="py-keyword">not</tt> <tt class="py-name">None</tt><tt class="py-op">:</tt> </tt>
<a name="L189"></a><tt class="py-lineno">189</tt>  <tt class="py-line">            <tt class="py-keyword">return</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">_repr</tt> </tt>
<a name="L190"></a><tt class="py-lineno">190</tt>  <tt class="py-line">        <tt class="py-name">dump</tt> <tt class="py-op">=</tt> <tt class="py-string">"&lt;msnobj Creator=%s Type=%s SHA1D=%s Size=%s Location=%s Friendly=%s/&gt;"</tt> <tt class="py-op">%</tt> \ </tt>
<a name="L191"></a><tt class="py-lineno">191</tt>  <tt class="py-line">            <tt class="py-op">(</tt><tt class="py-name">xml</tt><tt class="py-op">.</tt><tt class="py-name">quoteattr</tt><tt class="py-op">(</tt><tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">_creator</tt><tt class="py-op">.</tt><tt id="link-20" class="py-name"><a title="pymsn.profile.Contact.account
pymsn.profile.Profile.account" class="py-name" href="#" onclick="return doclink('link-20', 'account', 'link-18');">account</a></tt><tt class="py-op">)</tt><tt class="py-op">,</tt>  </tt>
<a name="L192"></a><tt class="py-lineno">192</tt>  <tt class="py-line">                <tt class="py-name">xml</tt><tt class="py-op">.</tt><tt class="py-name">quoteattr</tt><tt class="py-op">(</tt><tt class="py-name">str</tt><tt class="py-op">(</tt><tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">_type</tt><tt class="py-op">)</tt><tt class="py-op">)</tt><tt class="py-op">,</tt>  </tt>
<a name="L193"></a><tt class="py-lineno">193</tt>  <tt class="py-line">                <tt class="py-name">xml</tt><tt class="py-op">.</tt><tt class="py-name">quoteattr</tt><tt class="py-op">(</tt><tt class="py-name">base64</tt><tt class="py-op">.</tt><tt class="py-name">b64encode</tt><tt class="py-op">(</tt><tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">_data_sha</tt><tt class="py-op">)</tt><tt class="py-op">)</tt><tt class="py-op">,</tt>  </tt>
<a name="L194"></a><tt class="py-lineno">194</tt>  <tt class="py-line">                <tt class="py-name">xml</tt><tt class="py-op">.</tt><tt class="py-name">quoteattr</tt><tt class="py-op">(</tt><tt class="py-name">str</tt><tt class="py-op">(</tt><tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">_size</tt><tt class="py-op">)</tt><tt class="py-op">)</tt><tt class="py-op">,</tt> </tt>
<a name="L195"></a><tt class="py-lineno">195</tt>  <tt class="py-line">                <tt class="py-name">xml</tt><tt class="py-op">.</tt><tt class="py-name">quoteattr</tt><tt class="py-op">(</tt><tt class="py-name">str</tt><tt class="py-op">(</tt><tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">_location</tt><tt class="py-op">)</tt><tt class="py-op">)</tt><tt class="py-op">,</tt>  </tt>
<a name="L196"></a><tt class="py-lineno">196</tt>  <tt class="py-line">                <tt class="py-name">xml</tt><tt class="py-op">.</tt><tt class="py-name">quoteattr</tt><tt class="py-op">(</tt><tt class="py-name">base64</tt><tt class="py-op">.</tt><tt class="py-name">b64encode</tt><tt class="py-op">(</tt><tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">_friendly</tt><tt class="py-op">)</tt><tt class="py-op">)</tt><tt class="py-op">)</tt> </tt>
<a name="L197"></a><tt class="py-lineno">197</tt>  <tt class="py-line">        <tt class="py-keyword">return</tt> <tt class="py-name">dump</tt> </tt>
</div></div><a name="L198"></a><tt class="py-lineno">198</tt>  <tt class="py-line"> </tt>
<a name="MSNObjectStore"></a><div id="MSNObjectStore-def"><a name="L199"></a><tt class="py-lineno">199</tt>  <tt class="py-line"> </tt>
<a name="L200"></a><tt class="py-lineno">200</tt> <a class="py-toggle" href="#" id="MSNObjectStore-toggle" onclick="return toggle('MSNObjectStore');">-</a><tt class="py-line"><tt class="py-keyword">class</tt> <a class="py-def-name" href="pymsn.p2p.MSNObjectStore-class.html">MSNObjectStore</a><tt class="py-op">(</tt><tt class="py-base-class">object</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="MSNObjectStore-collapsed" style="display:none;" pad="+++" indent="++++"></div><div id="MSNObjectStore-expanded"><a name="L201"></a><tt class="py-lineno">201</tt>  <tt class="py-line"> </tt>
<a name="MSNObjectStore.__init__"></a><div id="MSNObjectStore.__init__-def"><a name="L202"></a><tt class="py-lineno">202</tt> <a class="py-toggle" href="#" id="MSNObjectStore.__init__-toggle" onclick="return toggle('MSNObjectStore.__init__');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="pymsn.p2p.MSNObjectStore-class.html#__init__">__init__</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">,</tt> <tt class="py-param">client</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="MSNObjectStore.__init__-collapsed" style="display:none;" pad="+++" indent="++++++++"></div><div id="MSNObjectStore.__init__-expanded"><a name="L203"></a><tt class="py-lineno">203</tt>  <tt class="py-line">        <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">_client</tt> <tt class="py-op">=</tt> <tt id="link-21" class="py-name"><a title="pymsn.client
pymsn.event.client" class="py-name" href="#" onclick="return doclink('link-21', 'client', 'link-13');">client</a></tt> </tt>
<a name="L204"></a><tt class="py-lineno">204</tt>  <tt class="py-line">        <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">_outgoing_sessions</tt> <tt class="py-op">=</tt> <tt class="py-op">{</tt><tt class="py-op">}</tt> <tt class="py-comment"># session =&gt; (handle_id, callback, errback)</tt> </tt>
<a name="L205"></a><tt class="py-lineno">205</tt>  <tt class="py-line">        <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">_incoming_sessions</tt> <tt class="py-op">=</tt> <tt class="py-op">{</tt><tt class="py-op">}</tt> </tt>
<a name="L206"></a><tt class="py-lineno">206</tt>  <tt class="py-line">        <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">_published_objects</tt> <tt class="py-op">=</tt> <tt class="py-name">set</tt><tt class="py-op">(</tt><tt class="py-op">)</tt> </tt>
<a name="L207"></a><tt class="py-lineno">207</tt>  <tt class="py-line">        <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">_client</tt><tt class="py-op">.</tt><tt class="py-name">_p2p_session_manager</tt><tt class="py-op">.</tt><tt class="py-name">connect</tt><tt class="py-op">(</tt><tt class="py-string">"incoming-session"</tt><tt class="py-op">,</tt> </tt>
<a name="L208"></a><tt class="py-lineno">208</tt>  <tt class="py-line">                <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">_incoming_session_received</tt><tt class="py-op">)</tt> </tt>
</div><a name="L209"></a><tt class="py-lineno">209</tt>  <tt class="py-line"> </tt>
<a name="MSNObjectStore.request"></a><div id="MSNObjectStore.request-def"><a name="L210"></a><tt class="py-lineno">210</tt> <a class="py-toggle" href="#" id="MSNObjectStore.request-toggle" onclick="return toggle('MSNObjectStore.request');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="pymsn.p2p.MSNObjectStore-class.html#request">request</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">,</tt> <tt class="py-param">msn_object</tt><tt class="py-op">,</tt> <tt class="py-param">callback</tt><tt class="py-op">,</tt> <tt class="py-param">errback</tt><tt class="py-op">=</tt><tt class="py-name">None</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="MSNObjectStore.request-collapsed" style="display:none;" pad="+++" indent="++++++++"></div><div id="MSNObjectStore.request-expanded"><a name="L211"></a><tt class="py-lineno">211</tt>  <tt class="py-line">        <tt class="py-keyword">if</tt> <tt id="link-22" class="py-name" targets="Variable pymsn.profile.Contact.msn_object=pymsn.profile.Contact-class.html#msn_object,Variable pymsn.profile.Profile.msn_object=pymsn.profile.Profile-class.html#msn_object"><a title="pymsn.profile.Contact.msn_object
pymsn.profile.Profile.msn_object" class="py-name" href="#" onclick="return doclink('link-22', 'msn_object', 'link-22');">msn_object</a></tt><tt class="py-op">.</tt><tt class="py-name">_data</tt> <tt class="py-keyword">is</tt> <tt class="py-keyword">not</tt> <tt class="py-name">None</tt><tt class="py-op">:</tt> </tt>
<a name="L212"></a><tt class="py-lineno">212</tt>  <tt class="py-line">            <tt class="py-name">callback</tt><tt class="py-op">[</tt><tt class="py-number">0</tt><tt class="py-op">]</tt><tt class="py-op">(</tt><tt id="link-23" class="py-name"><a title="pymsn.profile.Contact.msn_object
pymsn.profile.Profile.msn_object" class="py-name" href="#" onclick="return doclink('link-23', 'msn_object', 'link-22');">msn_object</a></tt><tt class="py-op">,</tt> <tt class="py-op">*</tt><tt class="py-name">callback</tt><tt class="py-op">[</tt><tt class="py-number">1</tt><tt class="py-op">:</tt><tt class="py-op">]</tt><tt class="py-op">)</tt> </tt>
<a name="L213"></a><tt class="py-lineno">213</tt>  <tt class="py-line"> </tt>
<a name="L214"></a><tt class="py-lineno">214</tt>  <tt class="py-line">        <tt class="py-keyword">if</tt> <tt id="link-24" class="py-name"><a title="pymsn.profile.Contact.msn_object
pymsn.profile.Profile.msn_object" class="py-name" href="#" onclick="return doclink('link-24', 'msn_object', 'link-22');">msn_object</a></tt><tt class="py-op">.</tt><tt class="py-name">_type</tt> <tt class="py-op">==</tt> <tt id="link-25" class="py-name" targets="Class pymsn.p2p.MSNObjectType=pymsn.p2p.MSNObjectType-class.html"><a title="pymsn.p2p.MSNObjectType" class="py-name" href="#" onclick="return doclink('link-25', 'MSNObjectType', 'link-25');">MSNObjectType</a></tt><tt class="py-op">.</tt><tt id="link-26" class="py-name"><a title="pymsn.p2p.MSNObjectType.CUSTOM_EMOTICON" class="py-name" href="#" onclick="return doclink('link-26', 'CUSTOM_EMOTICON', 'link-3');">CUSTOM_EMOTICON</a></tt><tt class="py-op">:</tt> </tt>
<a name="L215"></a><tt class="py-lineno">215</tt>  <tt class="py-line">            <tt class="py-name">application_id</tt> <tt class="py-op">=</tt> <tt class="py-name">ApplicationID</tt><tt class="py-op">.</tt><tt class="py-name">CUSTOM_EMOTICON_TRANSFER</tt> </tt>
<a name="L216"></a><tt class="py-lineno">216</tt>  <tt class="py-line">        <tt class="py-keyword">elif</tt> <tt id="link-27" class="py-name"><a title="pymsn.profile.Contact.msn_object
pymsn.profile.Profile.msn_object" class="py-name" href="#" onclick="return doclink('link-27', 'msn_object', 'link-22');">msn_object</a></tt><tt class="py-op">.</tt><tt class="py-name">_type</tt> <tt class="py-op">==</tt> <tt id="link-28" class="py-name"><a title="pymsn.p2p.MSNObjectType" class="py-name" href="#" onclick="return doclink('link-28', 'MSNObjectType', 'link-25');">MSNObjectType</a></tt><tt class="py-op">.</tt><tt id="link-29" class="py-name"><a title="pymsn.p2p.MSNObjectType.DISPLAY_PICTURE" class="py-name" href="#" onclick="return doclink('link-29', 'DISPLAY_PICTURE', 'link-4');">DISPLAY_PICTURE</a></tt><tt class="py-op">:</tt> </tt>
<a name="L217"></a><tt class="py-lineno">217</tt>  <tt class="py-line">            <tt class="py-name">application_id</tt> <tt class="py-op">=</tt> <tt class="py-name">ApplicationID</tt><tt class="py-op">.</tt><tt class="py-name">DISPLAY_PICTURE_TRANSFER</tt> </tt>
<a name="L218"></a><tt class="py-lineno">218</tt>  <tt class="py-line">        <tt class="py-keyword">else</tt><tt class="py-op">:</tt> </tt>
<a name="L219"></a><tt class="py-lineno">219</tt>  <tt class="py-line">            <tt class="py-keyword">raise</tt> <tt class="py-name">NotImplementedError</tt> </tt>
<a name="L220"></a><tt class="py-lineno">220</tt>  <tt class="py-line"> </tt>
<a name="L221"></a><tt class="py-lineno">221</tt>  <tt class="py-line">        <tt class="py-name">session</tt> <tt class="py-op">=</tt> <tt class="py-name">OutgoingP2PSession</tt><tt class="py-op">(</tt><tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">_client</tt><tt class="py-op">.</tt><tt class="py-name">_p2p_session_manager</tt><tt class="py-op">,</tt>  </tt>
<a name="L222"></a><tt class="py-lineno">222</tt>  <tt class="py-line">                <tt id="link-30" class="py-name"><a title="pymsn.profile.Contact.msn_object
pymsn.profile.Profile.msn_object" class="py-name" href="#" onclick="return doclink('link-30', 'msn_object', 'link-22');">msn_object</a></tt><tt class="py-op">.</tt><tt class="py-name">_creator</tt><tt class="py-op">,</tt> <tt id="link-31" class="py-name"><a title="pymsn.profile.Contact.msn_object
pymsn.profile.Profile.msn_object" class="py-name" href="#" onclick="return doclink('link-31', 'msn_object', 'link-22');">msn_object</a></tt><tt class="py-op">,</tt>  </tt>
<a name="L223"></a><tt class="py-lineno">223</tt>  <tt class="py-line">                <tt class="py-name">EufGuid</tt><tt class="py-op">.</tt><tt class="py-name">MSN_OBJECT</tt><tt class="py-op">,</tt> <tt class="py-name">application_id</tt><tt class="py-op">)</tt> </tt>
<a name="L224"></a><tt class="py-lineno">224</tt>  <tt class="py-line">        <tt class="py-name">handle_id</tt> <tt class="py-op">=</tt> <tt class="py-name">session</tt><tt class="py-op">.</tt><tt class="py-name">connect</tt><tt class="py-op">(</tt><tt class="py-string">"transfer-completed"</tt><tt class="py-op">,</tt> </tt>
<a name="L225"></a><tt class="py-lineno">225</tt>  <tt class="py-line">                <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">_outgoing_session_transfer_completed</tt><tt class="py-op">)</tt> </tt>
<a name="L226"></a><tt class="py-lineno">226</tt>  <tt class="py-line">        <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">_outgoing_sessions</tt><tt class="py-op">[</tt><tt class="py-name">session</tt><tt class="py-op">]</tt> <tt class="py-op">=</tt> \ </tt>
<a name="L227"></a><tt class="py-lineno">227</tt>  <tt class="py-line">                <tt class="py-op">(</tt><tt class="py-name">handle_id</tt><tt class="py-op">,</tt> <tt class="py-name">callback</tt><tt class="py-op">,</tt> <tt class="py-name">errback</tt><tt class="py-op">,</tt> <tt id="link-32" class="py-name"><a title="pymsn.profile.Contact.msn_object
pymsn.profile.Profile.msn_object" class="py-name" href="#" onclick="return doclink('link-32', 'msn_object', 'link-22');">msn_object</a></tt><tt class="py-op">)</tt> </tt>
</div><a name="L228"></a><tt class="py-lineno">228</tt>  <tt class="py-line"> </tt>
<a name="MSNObjectStore.publish"></a><div id="MSNObjectStore.publish-def"><a name="L229"></a><tt class="py-lineno">229</tt> <a class="py-toggle" href="#" id="MSNObjectStore.publish-toggle" onclick="return toggle('MSNObjectStore.publish');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="pymsn.p2p.MSNObjectStore-class.html#publish">publish</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">,</tt> <tt class="py-param">msn_object</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="MSNObjectStore.publish-collapsed" style="display:none;" pad="+++" indent="++++++++"></div><div id="MSNObjectStore.publish-expanded"><a name="L230"></a><tt class="py-lineno">230</tt>  <tt class="py-line">        <tt class="py-keyword">if</tt> <tt id="link-33" class="py-name"><a title="pymsn.profile.Contact.msn_object
pymsn.profile.Profile.msn_object" class="py-name" href="#" onclick="return doclink('link-33', 'msn_object', 'link-22');">msn_object</a></tt><tt class="py-op">.</tt><tt class="py-name">_data</tt> <tt class="py-keyword">is</tt> <tt class="py-name">None</tt><tt class="py-op">:</tt> </tt>
<a name="L231"></a><tt class="py-lineno">231</tt>  <tt class="py-line">            <tt id="link-34" class="py-name"><a title="pymsn.client.logger
pymsn.conversation.logger
pymsn.p2p.logger" class="py-name" href="#" onclick="return doclink('link-34', 'logger', 'link-2');">logger</a></tt><tt class="py-op">.</tt><tt class="py-name">warning</tt><tt class="py-op">(</tt><tt class="py-string">"Trying to publish an empty MSNObject"</tt><tt class="py-op">)</tt> </tt>
<a name="L232"></a><tt class="py-lineno">232</tt>  <tt class="py-line">        <tt class="py-keyword">else</tt><tt class="py-op">:</tt> </tt>
<a name="L233"></a><tt class="py-lineno">233</tt>  <tt class="py-line">            <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">_published_objects</tt><tt class="py-op">.</tt><tt class="py-name">add</tt><tt class="py-op">(</tt><tt id="link-35" class="py-name"><a title="pymsn.profile.Contact.msn_object
pymsn.profile.Profile.msn_object" class="py-name" href="#" onclick="return doclink('link-35', 'msn_object', 'link-22');">msn_object</a></tt><tt class="py-op">)</tt> </tt>
</div><a name="L234"></a><tt class="py-lineno">234</tt>  <tt class="py-line"> </tt>
<a name="MSNObjectStore._outgoing_session_transfer_completed"></a><div id="MSNObjectStore._outgoing_session_transfer_completed-def"><a name="L235"></a><tt class="py-lineno">235</tt> <a class="py-toggle" href="#" id="MSNObjectStore._outgoing_session_transfer_completed-toggle" onclick="return toggle('MSNObjectStore._outgoing_session_transfer_completed');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="pymsn.p2p.MSNObjectStore-class.html#_outgoing_session_transfer_completed">_outgoing_session_transfer_completed</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">,</tt> <tt class="py-param">session</tt><tt class="py-op">,</tt> <tt class="py-param">data</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="MSNObjectStore._outgoing_session_transfer_completed-collapsed" style="display:none;" pad="+++" indent="++++++++"></div><div id="MSNObjectStore._outgoing_session_transfer_completed-expanded"><a name="L236"></a><tt class="py-lineno">236</tt>  <tt class="py-line">        <tt class="py-name">handle_id</tt><tt class="py-op">,</tt> <tt class="py-name">callback</tt><tt class="py-op">,</tt> <tt class="py-name">errback</tt><tt class="py-op">,</tt> <tt id="link-36" class="py-name"><a title="pymsn.profile.Contact.msn_object
pymsn.profile.Profile.msn_object" class="py-name" href="#" onclick="return doclink('link-36', 'msn_object', 'link-22');">msn_object</a></tt> <tt class="py-op">=</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">_outgoing_sessions</tt><tt class="py-op">[</tt><tt class="py-name">session</tt><tt class="py-op">]</tt> </tt>
<a name="L237"></a><tt class="py-lineno">237</tt>  <tt class="py-line">        <tt class="py-name">session</tt><tt class="py-op">.</tt><tt class="py-name">disconnect</tt><tt class="py-op">(</tt><tt class="py-name">handle_id</tt><tt class="py-op">)</tt> </tt>
<a name="L238"></a><tt class="py-lineno">238</tt>  <tt class="py-line">        <tt id="link-37" class="py-name"><a title="pymsn.profile.Contact.msn_object
pymsn.profile.Profile.msn_object" class="py-name" href="#" onclick="return doclink('link-37', 'msn_object', 'link-22');">msn_object</a></tt><tt class="py-op">.</tt><tt class="py-name">_data</tt> <tt class="py-op">=</tt> <tt class="py-name">data</tt> </tt>
<a name="L239"></a><tt class="py-lineno">239</tt>  <tt class="py-line"> </tt>
<a name="L240"></a><tt class="py-lineno">240</tt>  <tt class="py-line">        <tt class="py-name">callback</tt><tt class="py-op">[</tt><tt class="py-number">0</tt><tt class="py-op">]</tt><tt class="py-op">(</tt><tt id="link-38" class="py-name"><a title="pymsn.profile.Contact.msn_object
pymsn.profile.Profile.msn_object" class="py-name" href="#" onclick="return doclink('link-38', 'msn_object', 'link-22');">msn_object</a></tt><tt class="py-op">,</tt> <tt class="py-op">*</tt><tt class="py-name">callback</tt><tt class="py-op">[</tt><tt class="py-number">1</tt><tt class="py-op">:</tt><tt class="py-op">]</tt><tt class="py-op">)</tt> </tt>
<a name="L241"></a><tt class="py-lineno">241</tt>  <tt class="py-line">        <tt class="py-keyword">del</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">_outgoing_sessions</tt><tt class="py-op">[</tt><tt class="py-name">session</tt><tt class="py-op">]</tt> </tt>
</div><a name="L242"></a><tt class="py-lineno">242</tt>  <tt class="py-line"> </tt>
<a name="MSNObjectStore._incoming_session_received"></a><div id="MSNObjectStore._incoming_session_received-def"><a name="L243"></a><tt class="py-lineno">243</tt> <a class="py-toggle" href="#" id="MSNObjectStore._incoming_session_received-toggle" onclick="return toggle('MSNObjectStore._incoming_session_received');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="pymsn.p2p.MSNObjectStore-class.html#_incoming_session_received">_incoming_session_received</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">,</tt> <tt class="py-param">session_manager</tt><tt class="py-op">,</tt> <tt class="py-param">session</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="MSNObjectStore._incoming_session_received-collapsed" style="display:none;" pad="+++" indent="++++++++"></div><div id="MSNObjectStore._incoming_session_received-expanded"><a name="L244"></a><tt class="py-lineno">244</tt>  <tt class="py-line">        <tt class="py-keyword">if</tt> <tt class="py-name">session</tt><tt class="py-op">.</tt><tt class="py-name">_euf_guid</tt> <tt class="py-op">!=</tt> <tt class="py-name">EufGuid</tt><tt class="py-op">.</tt><tt class="py-name">MSN_OBJECT</tt><tt class="py-op">:</tt> </tt>
<a name="L245"></a><tt class="py-lineno">245</tt>  <tt class="py-line">            <tt class="py-keyword">return</tt> </tt>
<a name="L246"></a><tt class="py-lineno">246</tt>  <tt class="py-line">        <tt class="py-name">handle_id</tt> <tt class="py-op">=</tt> <tt class="py-name">session</tt><tt class="py-op">.</tt><tt class="py-name">connect</tt><tt class="py-op">(</tt><tt class="py-string">"transfer-completed"</tt><tt class="py-op">,</tt> </tt>
<a name="L247"></a><tt class="py-lineno">247</tt>  <tt class="py-line">                        <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">_incoming_session_transfer_completed</tt><tt class="py-op">)</tt> </tt>
<a name="L248"></a><tt class="py-lineno">248</tt>  <tt class="py-line">        <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">_incoming_sessions</tt><tt class="py-op">[</tt><tt class="py-name">session</tt><tt class="py-op">]</tt> <tt class="py-op">=</tt> <tt class="py-name">handle_id</tt> </tt>
<a name="L249"></a><tt class="py-lineno">249</tt>  <tt class="py-line">        <tt class="py-keyword">try</tt><tt class="py-op">:</tt> </tt>
<a name="L250"></a><tt class="py-lineno">250</tt>  <tt class="py-line">            <tt id="link-39" class="py-name"><a title="pymsn.profile.Contact.msn_object
pymsn.profile.Profile.msn_object" class="py-name" href="#" onclick="return doclink('link-39', 'msn_object', 'link-22');">msn_object</a></tt> <tt class="py-op">=</tt> <tt id="link-40" class="py-name"><a title="pymsn.p2p.MSNObject" class="py-name" href="#" onclick="return doclink('link-40', 'MSNObject', 'link-17');">MSNObject</a></tt><tt class="py-op">.</tt><tt id="link-41" class="py-name"><a title="pymsn.conversation.TextFormat.parse
pymsn.p2p.MSNObject.parse" class="py-name" href="#" onclick="return doclink('link-41', 'parse', 'link-12');">parse</a></tt><tt class="py-op">(</tt><tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">_client</tt><tt class="py-op">,</tt> <tt class="py-name">session</tt><tt class="py-op">.</tt><tt class="py-name">_context</tt><tt class="py-op">)</tt> </tt>
<a name="L251"></a><tt class="py-lineno">251</tt>  <tt class="py-line">        <tt class="py-keyword">except</tt> <tt class="py-name">ParseError</tt><tt class="py-op">:</tt> </tt>
<a name="L252"></a><tt class="py-lineno">252</tt>  <tt class="py-line">            <tt class="py-name">session</tt><tt class="py-op">.</tt><tt class="py-name">reject</tt><tt class="py-op">(</tt><tt class="py-op">)</tt> </tt>
<a name="L253"></a><tt class="py-lineno">253</tt>  <tt class="py-line">            <tt class="py-keyword">return</tt> </tt>
<a name="L254"></a><tt class="py-lineno">254</tt>  <tt class="py-line">        <tt class="py-keyword">for</tt> <tt class="py-name">obj</tt> <tt class="py-keyword">in</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">_published_objects</tt><tt class="py-op">:</tt> </tt>
<a name="L255"></a><tt class="py-lineno">255</tt>  <tt class="py-line">            <tt class="py-keyword">if</tt> <tt class="py-name">obj</tt><tt class="py-op">.</tt><tt class="py-name">_data_sha</tt> <tt class="py-op">==</tt> <tt id="link-42" class="py-name"><a title="pymsn.profile.Contact.msn_object
pymsn.profile.Profile.msn_object" class="py-name" href="#" onclick="return doclink('link-42', 'msn_object', 'link-22');">msn_object</a></tt><tt class="py-op">.</tt><tt class="py-name">_data_sha</tt><tt class="py-op">:</tt> </tt>
<a name="L256"></a><tt class="py-lineno">256</tt>  <tt class="py-line">                <tt class="py-name">session</tt><tt class="py-op">.</tt><tt class="py-name">accept</tt><tt class="py-op">(</tt><tt class="py-name">obj</tt><tt class="py-op">.</tt><tt class="py-name">_data</tt><tt class="py-op">)</tt> </tt>
<a name="L257"></a><tt class="py-lineno">257</tt>  <tt class="py-line">                <tt class="py-keyword">return</tt> </tt>
<a name="L258"></a><tt class="py-lineno">258</tt>  <tt class="py-line">        <tt class="py-name">session</tt><tt class="py-op">.</tt><tt class="py-name">reject</tt><tt class="py-op">(</tt><tt class="py-op">)</tt> </tt>
</div><a name="L259"></a><tt class="py-lineno">259</tt>  <tt class="py-line"> </tt>
<a name="MSNObjectStore._incoming_session_transfer_completed"></a><div id="MSNObjectStore._incoming_session_transfer_completed-def"><a name="L260"></a><tt class="py-lineno">260</tt> <a class="py-toggle" href="#" id="MSNObjectStore._incoming_session_transfer_completed-toggle" onclick="return toggle('MSNObjectStore._incoming_session_transfer_completed');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="pymsn.p2p.MSNObjectStore-class.html#_incoming_session_transfer_completed">_incoming_session_transfer_completed</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">,</tt> <tt class="py-param">session</tt><tt class="py-op">,</tt> <tt class="py-param">data</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="MSNObjectStore._incoming_session_transfer_completed-collapsed" style="display:none;" pad="+++" indent="++++++++"></div><div id="MSNObjectStore._incoming_session_transfer_completed-expanded"><a name="L261"></a><tt class="py-lineno">261</tt>  <tt class="py-line">        <tt class="py-name">handle_id</tt> <tt class="py-op">=</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">_incoming_sessions</tt><tt class="py-op">[</tt><tt class="py-name">session</tt><tt class="py-op">]</tt> </tt>
<a name="L262"></a><tt class="py-lineno">262</tt>  <tt class="py-line">        <tt class="py-name">session</tt><tt class="py-op">.</tt><tt class="py-name">disconnect</tt><tt class="py-op">(</tt><tt class="py-name">handle_id</tt><tt class="py-op">)</tt> </tt>
<a name="L263"></a><tt class="py-lineno">263</tt>  <tt class="py-line">        <tt class="py-keyword">del</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">_incoming_sessions</tt><tt class="py-op">[</tt><tt class="py-name">session</tt><tt class="py-op">]</tt> </tt>
</div></div><a name="L264"></a><tt class="py-lineno">264</tt>  <tt class="py-line"> </tt><script type="text/javascript">
<!--
expandto(location.href);
// -->
</script>
</pre>
<br />
<!-- ==================== NAVIGATION BAR ==================== -->
<table class="navbar" border="0" width="100%" cellpadding="0"
       bgcolor="#a0c0ff" cellspacing="0">
  <tr valign="middle">

  <!-- Tree link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="module-tree.html">Trees</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Index link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="identifier-index.html">Indices</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Help link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="help.html">Help</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Project homepage -->
      <th class="navbar" align="right" width="100%">
        <table border="0" cellpadding="0" cellspacing="0">
          <tr><th class="navbar" align="center"
            ><a class="navbar" target="_top" href="http://telepathy.freedesktop.org/wiki/Pymsn">pymsn</a></th>
          </tr></table></th>
  </tr>
</table>
<table border="0" cellpadding="0" cellspacing="0" width="100%%">
  <tr>
    <td align="left" class="footer">
    Generated by Epydoc 3.0.1 on Sun Aug  2 15:19:18 2009
    </td>
    <td align="right" class="footer">
      <a target="mainFrame" href="http://epydoc.sourceforge.net"
        >http://epydoc.sourceforge.net</a>
    </td>
  </tr>
</table>

<script type="text/javascript">
  <!--
  // Private objects are initially displayed (because if
  // javascript is turned off then we want them to be
  // visible); but by default, we want to hide them.  So hide
  // them unless we have a cookie that says to show them.
  checkCookie();
  // -->
</script>
</body>
</html>
